home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / archiver / compress.zoo / compress.h < prev    next >
C/C++ Source or Header  |  1989-06-30  |  27KB  |  800 lines

  1. /*@H************************ < COMPRESS HEADER > ****************************
  2. *   $@(#) compress.c,v 4.3 88/12/26 08:00:00 don Release ^                  *
  3. *                                                                           *
  4. *   compress : compress.h <global defines, etc>                             *
  5. *                                                                           *
  6. *   port by  : Donald J. Gloistein                                          *
  7. *                                                                           *
  8. *   Source, Documentation, Object Code:                                     *
  9. *   released to Public Domain.  This code is based on code as documented    *
  10. *   below in release notes.                                                 *
  11. *                                                                           *
  12. *---------------------------  Module Description  --------------------------*
  13. *   THIS HEADER CONTAINS MUCH IMPLEMENTATION INFORMATION AND ASSUMPTIONS    *
  14. *   PLEASE PRINT IT OUT AND READ IT BEFORE COMPILING CODE FOR YOURSELF      *
  15. *                                                                           *
  16. *   This header supports a number of compiler defines and predefines.       *
  17. *   Rather than explain all of them, please print the header and read the   *
  18. *   notes. Also the unix and xenix makefiles are commented for the          *
  19. *   various options. There continues to have a lot of Dos specific info in  *
  20. *   the header. This is to help on 16 bit Msdos machines to get their       *
  21. *   compiler to work properly. I make no appology for that, as this port    *
  22. *   began as a way to implement 16 bit compress on a segmented MsDos machine*
  23. *                                                                           *
  24. *   However, for Unix and Xenix, all you should have to define is -DXENIX   *
  25. *   or -DUNIX and compile. There may be a problem with whether your library *
  26. *   supports alloc() or malloc(), but there is a define for that, also.     *
  27. *                                                                           *
  28. *   This header can be maintained to keep up with the different compilers   *
  29. *   and systems. As distributed in don Release, the files will compile with *
  30. *   no changes under Microsoft version 5.1 C compiler, and Xenix C compiler *
  31. *   which is the Microsoft version 4 ported. If you are going to bind the   *
  32. *   code for use in MsDos and OS/2 machines, then you must uncomment the    *
  33. *   #define BIND in this header. Otherwise, this distribution of source     *
  34. *   detect Msdos and Xenix predefines from the compiler and adjust.         *
  35. *                                                                           *
  36. *--------------------------- Implementation Notes --------------------------*
  37. *                                                                           *
  38. *   compiled with : compress.fns                                            *
  39. *
  40. *   NOTE!!!  Defaults of this code now are completely Unix, even for the    *
  41. *            msdos ports.  That means that the program works as a filter,   *
  42. *            and will just sit there waiting for input from stdin if you    *
  43. *            issue just the command name. You must use -h or -? to get the  *
  44. *            full help screen now. Also, it will unlink (kill) as a default *
  45. *            on successful compression and decompression. That means the    *
  46. *            source file will be erased.                                    *
  47. *            These defaults are changed with the FILTER and KEEPFLAG        *
  48. *            defines.                                                       *
  49. *                                                                           *
  50. *   NOTE!!!  Compiler predefines were taken out of the compress.h header.   *
  51. *            You must either specify them on compile or uncomment the       *
  52. *            compiler define in this header. Compiling without doing these  *
  53. *            will result in a program that does unspecified actions.        *
  54. *   problems:                                                               *
  55. *            The inpath and outpath is a bit kludged. It should work okay.  *
  56. *            Let me know if you have problems, especially under Unix.       *
  57. *                                                                           *
  58. *   CAUTION: The bound version will run on Dos 2.x, but you must use the    *
  59. *            name compress.exe.  If you rename the file, it will not run    *
  60. *            The unbound version will run on Dos 2.x with the name changed  *
  61. *            but due to the dos version, will not detect its own name.      *
  62. *                                                                           *
  63. *   CAUTION: Non MsDos users. You must modify the _MAX_PATH defines for     *
  64. *            your operating system if it is different from the assumed      *
  65. *            standard.                                                      *
  66. *                                                                           *
  67. *   CAUTION: I have used a number of defines to make it possible to compile *
  68. *            properly under a number of bit sizes and adjust for the memory *
  69. *            allocation scheme needed. If you do not use a dos system,      *
  70. *            PLEASE pay attention to the defines for MAXSEG_64 and the one  *
  71. *            called SMALLMODEL. The SMALLMODEL define is set in the header  *
  72. *            but if you don't have a compiler that triggers the MAXSEG_64   *
  73. *            define, you may end up with bad pointers. Becareful.           *
  74. *                                                                           *
  75. *   Header for files using version 4 compress routines define MAIN          *
  76. *   in the file with defining instance of the global variables.             *
  77. *   There are a number of compilers for MsDos and Unix/Xenix.               *
  78. *   So the user must define the actions required.                           *
  79. *                                                                           *
  80. *                                                                           *
  81. *   Defines:  This header file contains most of the system wide defines.    *
  82. *             the purpose for this was to consolodate compiler differences  *
  83. *             into one area that is easily changed.                         *
  84. *                                                                           *
  85. *   define MAXBITS= if you want a different maximum bits. 16 bits will now  *
  86. *   run in about 400K of memory.                                            *
  87. *   define BIND if you are going to use Microsoft bind.exe program on the   *
  88. *   executable.                                                             *
  89. *                                                                           *
  90. *   define MSDOS if you are compiling under MsDos or PcDos and your compiler*
  91. *   does not predefine it.                                                  *
  92. *                                                                           *
  93. *     Initials ---- Name ---------------------------------                  *
  94. *      DjG          Donald J. Gloistein, current port to MsDos 16 bit       *
  95. *                   Plus many others, see rev.hst file for full list        *
  96. *      LvR          Lyle V. Rains, many thanks for improved implementation  *
  97. *                   of the compression and decompression routines.          *
  98. *************************************************************************@H*/
  99.  
  100. #ifndef FALSE            /* let's get some sense to this */
  101. #define FALSE 0
  102. #define TRUE !FALSE
  103. #endif
  104.  
  105.  
  106.  
  107. #ifdef UNIX
  108. #define NPROTO
  109. #define COMP40           /* take this out for a little more speed */
  110. #ifdef ALLOC
  111. char *alloc();
  112. #define ALLOCATE(x,y)   alloc((unsigned int)x*y)
  113. #else
  114. char *malloc();
  115. #define ALLOCATE(x,y)   malloc((unsigned int)x*y)
  116. #endif
  117. #define FREEIT(ptr)     free(ptr)
  118. #define setbinary(fp)
  119. #define NO_SETVBUF      /* most don't support setvbuf() function */
  120. #endif
  121.  
  122.             /* NOTE: This program will not work on the */
  123.             /* IBM/PC version of MINIX due to the small */
  124.             /* memory model restrictions.